const express = require('express');
const path = require('path')
var proxy = require('http-proxy-middleware');
const app = express();

app.use(express.static(__dirname + '/'));
app.use('/public', express.static(path.join(__dirname, './public')))

app.use(express.static(path.join(__dirname, 'views')))
app.engine('html', require('ejs').__express);
app.set('views', './views')
app.set('view engine', 'html');

// app.use('/api', proxy({ target: 'http://127.0.0.1:8080/', changeOrigin: true }));   //proxy

app.get('/', (req, res) => {
    res.render('index.html');
});

app.listen(9060, () => {
    console.log('Server is running at http://localhost:9060')
})